#include <iostream>
#include <ctime>
#include <cstdlib>
#include <unordered_set>

int const n = 5;
int m = 10;
bool map[n][n];

int main()
{
	std::cout << "1\n" << n << ' '  << m << '\n';
	std::srand(std::time(0));
	std::unordered_set<int> con;
	con.insert(1);
	for (int ti = 0; ti < n-1; ti++) {
		int u = rand() % n + 1;
		for (; con.find(u) == con.end(); u = rand() % n + 1);
		int v = rand() % n + 1;
		for (; con.find(v) != con.end(); v = rand() % n + 1);

		map[u][v] = map[v][u] = true;
		std::cout << u << ' ' << v << '\n';
		con.insert(v);
	}
	m -= n-1;
	for (int i = 0; i < m; i++)
		std::cout << rand() % n + 1 << ' ' << rand() % n + 1 << '\n';
}

